//客户端
package com.callback2;

public class User {
    private String name;
    private App app;
    public User(String name, App app){
        this.name = name;
        this.app = app;
    }

    public void buy(final String thing){
        System.out.println("用户端：购买" + thing);
        new Thread(new Runnable() {
            @Override
            public void run() {
                app.order(new MyCallback(), thing);
            }
        }).start();
        System.out.println("用户端：物品购买中，请耐心等待");
    }
}
